<?php
if (APPLICATION_ENV == 'production') {
    $files = array();
    foreach($this->JQuery()->getJavascriptFiles() as $k => $v) {
        if(preg_match('#custom_.*#', basename($v))) {
            $files[] = $v;
        }
    }
    $this->JQuery()->clearJavascriptFiles();
    foreach($files as $f) {
        $this->JQuery()->addJavascriptFile($f);
    }
    $this->JQuery()->addJavascriptFile(Ac_Util::getImageBaseUrl('/js/all.min.v-'.AC_VERSION.'.js'));
} else {
    $this->JQuery()->addJavascriptFile(Ac_Util::getImageBaseUrl('/js/tipsy/jquery.tipsy.v-'.AC_VERSION.'.js'));
    $this->JQuery()->addJavascriptFile(Ac_Util::getImageBaseUrl('/js/script.v-'.AC_VERSION.'.js'));
}

if (APPLICATION_ENV == 'production') {
    $this->headLink()->prependStylesheet(Ac_Util::getImageBaseUrl('/css/all.v-'.AC_VERSION.'.css'));
} else {
    $this->headLink()->prependStylesheet(Ac_Util::getFileSubdomain('/css/custom.v-'.AC_VERSION.'.css'));
    $this->headLink()->prependStylesheet(Ac_Util::getImageBaseUrl('/css/style.v-'.AC_VERSION.'.css'));
//    $this->headLink()->prependStylesheet(Ac_Util::getFileSubdomain('/css/custom_index.v-'.AC_VERSION.'.css'));
}
?>
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="zh"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<?php echo $this->headTitle()?>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width,initial-scale=1">
<?php echo $this->headLink()?>
<?php echo $this->headStyle()?>
<script src="<?php echo Ac_Util::getImageBaseUrl('/js/modernizr-2.0.6.min.js')?>"></script>
<?php if (defined('GOOGLE_ANALYTICS')): ?>
    <script type="text/javascript">

      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', '<?php echo GOOGLE_ANALYTICS ?>']);
      _gaq.push(['_setDomainName', 'maozhao.com']);
      _gaq.push(['_trackPageview']);

      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();

    </script>  
<?php endif;?>
</head>
<body>
<div id="container" class="container <?php echo $this->placeholder('container-class');?>">
    <!-- start header -->
    <?php echo $this->partial('index/header.phtml', 'default');?>    
    <!-- end header -->

    <!-- start content -->
    <?php echo $this->layout()->content; ?>
    <!-- end content -->

    <!-- start footer -->
    <?php echo $this->Partial('index/footer.phtml', 'default'); ?>
    <!-- end footer -->
</div>
<!--! end of #container -->

<!--[if lt IE 7 ]>
    <script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script>
    <script>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script>
  <![endif]-->
  	<?php echo $this->headScript() ?>
	<?php echo $this->JQuery() ?>
</body>
</html>
